#ifndef RTERROR_H
#define RTERROR_H

/*
 * To add error code to your module, you need to do the following:
 *
 * 1) Add a module offset code.  Add yours to the bottom of the list 
 *    right below this comment, adding 10000.
 *
 * 2) In your module, define a header file which uses addition.  An examples below:
 *
 *    #define RT_ERROR_MYMODULE_MYERROR1 (RT_ERROR_MODULE_MYMODULE + 1)
 *
 */

#define RT_ERROR_MODULE_BASE      10000
#define RT_ERROR_MODULE_NETWORK   20000
#define RT_ERROR_MODULE_DB        30000


#define RT_FAILED(rv) (rv != 0)
#define RT_SUCCEEDED(rv) (rv == 0)

/* Standard "it worked" return value */
#define RT_OK                              0

/* Returned when a function fails */
#define RT_ERROR_FAILURE                   (RtResult)(RT_ERROR_MODULE_BASE + 1)

/* Returned when an instance is not initialized */
#define RT_ERROR_NOT_INITIALIZED           (RtResult)(RT_ERROR_MODULE_BASE + 2)

/* Returned when an instance is already initialized */
#define RT_ERROR_ALREADY_INITIALIZED       (RtResult)(RT_ERROR_MODULE_BASE + 3)

/* Returned by a not implemented function */
#define RT_ERROR_NOT_IMPLEMENTED           (RtResult)(RT_ERROR_MODULE_BASE + 4)

#define RT_ERROR_NULL_POINTER              (RtResult)(RT_ERROR_MODULE_BASE + 5)

/* Returned when an unexpected error occurs */
#define RT_ERROR_UNEXPECTED                (RtResult)(RT_ERROR_MODULE_BASE + 6)

/* Returned when a memory allocation fails */
#define RT_ERROR_OUT_OF_MEMORY             (RtResult)(RT_ERROR_MODULE_BASE + 7)

/* Returned when an illegal value is passed */
#define RT_ERROR_INVALID_ARG               (RtResult)(RT_ERROR_MODULE_BASE + 8)

/* Returned when an operation can't complete due to an unavailable resource */
#define RT_ERROR_NOT_AVAILABLE             (RtResult)(RT_ERROR_MODULE_BASE + 9)

#define RT_ERROR_WOULD_BLOCK               (RtResult)(RT_ERROR_MODULE_BASE + 10)

#define RT_ERROR_NOT_FOUND                 (RtResult)(RT_ERROR_MODULE_BASE + 11)

#define RT_ERROR_FOUND                     (RtResult)(RT_ERROR_MODULE_BASE + 12)

#define RT_ERROR_PARTIAL_DATA              (RtResult)(RT_ERROR_MODULE_BASE + 13)

#define RT_ERROR_TIMEOUT                   (RtResult)(RT_ERROR_MODULE_BASE + 14)

#define RT_ERROR_WRONG_STATUS				(RtResult)(RT_ERROR_MODULE_BASE + 15)

//add for box 4. 1 GC
#define RT_ERROR_NEED_RETRY			(RtResult)(RT_ERROR_MODULE_BASE + 16)




#endif // RTERROR_H
